var devsite=devsite||{};devsite.devsite=devsite.devsite||{};$(document).ready(function(){$("a.sign-in-link").bind("mousedown click",devsite.devsite.login);$("a.sign-out-link").bind("mousedown click",devsite.devsite.logout);devsite.devsite.loggedIn(function(e,b){b?devsite.devsite.showError("Error while signing in: "+b):$("#sign-in-io").hasClass("trig")&&devsite.reloadWindow()})});
window.IO_2012=function(){var e=function(){var d,c,a=function(){var a=$(this),i=a.parent(),a=a.siblings().clone(),j=i.position(),h=j.top,j=j.left,f=parseInt(i.css("padding-left"),10);if(0===f||d.hasClass("resized")){var b=i.find(".photo").width(),f=(i.outerWidth()-b)/2;c.css("width",b+4*f+"px");h+=f}else j+=f,c.css("width","auto");h+=f;i=f+f/2;c.show().empty().append(a).css({padding:0,top:h+"px",left:j+"px"});c.animate({paddingTop:i,paddingBottom:i,top:h-2*f-15},150);c.animate({paddingLeft:i,paddingRight:i,
left:j-i},150)},n=function(){c.hide();!d.hasClass("resized")&&980>d.width()?d.removeClass("full").addClass("resized"):d.hasClass("resized")&&980<=d.width()&&d.removeClass("resized").addClass("full")},k=function(a){var d=$(a.target);c.is(":visible")&&!d.is(c)&&!$.contains(c[0],d[0])&&!d.is(".expand")&&(c.hide(),a.stopPropagation())},b=function(){d=$("#about-features.grid");c=d.find("#grid-zoom").hide();980>d.width()&&d.removeClass("full").addClass("resized");d.find("button.expand").bind("click touchend",
a);$(window).resize(n);$(document).bind("click touchend",k)};return{init:b}}(),b=function(){var d=function(){$(".expand").bind("click",function(){$(".col").toggleClass("collapsed");return!1})};return{init:d}}(),m=function(){var d,c,a,b,k,e=function(){b=b.getTime();var a=new Date("March 27, 2012 7:00:00 am PDT");d=a.getTime();g();k=setInterval(g,1E3)},g=function(){b+=1E3;!a.hasClass("open")&&b>=d&&b<d+6048E5?(a.addClass("open"),a.find("h3").html("Registration is open"),a.append('<input type="Submit" value="Register" class="small-button red" />')):
b>=d+6048E5&&(a.removeClass("open").addClass("closed"),a.find("#options").remove(),a.find("h3").html("Registration is closed"),clearInterval(k))},i=function(){a.find(".small-button").attr("disabled",!$("#terms").is(":checked"))},j=function(){c=$("#reg-time");a=c.find(".oclock");a.hasClass("closed")?a.find("h3").html("Registration is closed"):(b=new Date,e(),!a.find(".small-button").length&&a.hasClass("open")&&(a.find("h3").html("Registration is open"),a.append('<input type="Submit" value="Register" class="small-button red" />')));
$("#sign-in-io").click(function(a){a.stopPropagation();$(this).addClass("trig");devsite.devsite.login()});$("#terms").click(i);i()};return{init:j}}(),p=function(){var d,b,a,e=function(){var g=this;a.geocode({latLng:g.position},function(a,j){var h='<address class="adr"><strong>'+g.title+"</strong>";if(j===google.maps.GeocoderStatus.OK)var f=a[0].address_components,h=h+('<span class="street-address">'+f[0].short_name+" "+f[1].short_name+"</span>"),h=void 0!==f[7]?h+('<span class="locality">'+f[3].long_name+
'</span>, <span class="region">'+f[5].short_name+'</span> <span class="postal-code">'+f[7].short_name+"</span>"):h+('<span class="locality">'+f[2].long_name+'</span>, <span class="region">'+f[3].short_name+'</span> <span class="postal-code">'+f[5].short_name+"</span>");h+="</address>";b.setContent(h);b.open(d,g)})},k=function(a,b){var c=new google.maps.LatLng(a.lat,a.lang),h=a.title,c=new google.maps.Marker({position:c,map:d,title:h,icon:new google.maps.MarkerImage(b.src,null,null,new google.maps.Point(0,
42))});google.maps.event.addListener(c,"click",e)},o=function(){var g=[{title:"Moscone Center",lat:37.783313,lang:-122.402614},{title:"Marriott Marquis San Francisco",lat:37.77264,lang:-122.409915},{title:"Parc 55 Wyndham San Francisco",lat:37.78491,lang:-122.408638},{title:"Westin Market Street",lat:37.786396,lang:-122.402853},{title:"InterContinental San Francisco",lat:37.782079,lang:-122.404764}];b=new google.maps.InfoWindow({content:"holding..."});a=new google.maps.Geocoder;d=new google.maps.Map($("#map")[0],
{center:new google.maps.LatLng(g[0].lat,g[0].lang),zoom:14,mapTypeId:google.maps.MapTypeId.ROADMAP});var i=document.createElement("img"),j=document.createElement("img");i.src="https://chart.googleapis.com/chart?chst=d_map_xpin_letter&chld=pin%7C+%7C4D90FE%7C000000%7CFF0000";j.src="https://chart.googleapis.com/chart?chst=d_map_xpin_letter&chld=pin%7C+%7CFF7B6F%7C000000%7CFF0000";google.maps.event.addDomListenerOnce(i,"load",function(){k(g[0],i)});google.maps.event.addDomListenerOnce(j,"load",function(){for(var a=
1;a<g.length;a++)k(g[a],j)})};return{init:o}}();(function(){for(var b=0,c=["ms","moz","webkit","o"],a=0;a<c.length&&!window.requestAnimationFrame;++a)window.requestAnimationFrame=window[c[a]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[c[a]+"CancelAnimationFrame"]||window[c[a]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(a){var c=(new Date).getTime(),e=Math.max(0,16-(c-b)),g=window.setTimeout(function(){a(c+e)},e);b=c+e;return g});
window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)})})();var l=function(){var b=$("<div id='particle_sequence'></div>"),c="/apps/images/io/particle_hover-frames.jpg",a=60,e=124,k=0,l=function(){var c=0;(function h(f){window.requestAnimationFrame(h);var g=Math.floor(k)*e;b.css("background-position","0 -"+g+"px");g=(f-c)/10;k+=g/2;k>=a&&(k=0);c=f})(0)},g=function(){var a=/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase());
a?b.hide():$(window).load(function(){var a=new Image;a.onload=function(){b.css("background","url('"+c+"') no-repeat 0 0");b.hide().appendTo("#experiment .content").fadeIn(function(){setTimeout(l,20)})};a.src=c})};return{init:g}}();return{about:e,afterHours:b,register:m,travel:p,particle:l}}();
$(document).ready(function(){var e=$("#nav-events"),b=e.find(".subnav").hide().css("position","fixed"),m=b.width();$("#wrapper").append(b.remove()).bind("click",function(e){var l=$(e.target);b.is(":visible")&&!l.is(b)&&!$.contains(b[0],l[0])&&!l.is(".subnav")&&(b.hide(),e.stopPropagation())});e.bind("mouseenter click",function(){b.show().css({top:e.offset().top+e.height(),left:e.offset().left+e.width()-m})});b.bind("mouseleave click",function(){b.hide()});e.bind("click",function(){b.show()});$("#nav-main li:not(#nav-events)").bind("mouseenter",
function(){b.hide()})});
